<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>map</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <script src="https://cdn.bootcss.com/echarts/4.4.0-rc.1/echarts-en.min.js"></script>
    <script src="/js/china.js"></script>
    <script src="/js/draw.js"></script>
    <script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.js"></script>

</head>
<body>
<?php
include "head.php";
?>

<h1 style="text-align: center">确诊数</h1>
<h2>湖北：<span id="hubei"></span></h2>

<div id="main">
</div>
<script type="text/javascript">
  $(function() {
    $.get('<?php echo $datapath; ?>', function(rs) {
      // console.log(data);
      var dataList = [];
      var hubei = {
        "provinceName": "湖北",
        "confirmedCount": 0,
        "suspectedCount": 0,
        "curedCount": 0,
        "deadCount": 0,
        "comment": "",
      };
      for (i in rs['data']['area']) {
        if (rs['data']['area'][i]['provinceName'] == undefined
        ) {

          continue;
        }
        if (rs['data']['area'][i]['provinceName'] == '湖北') {
          hubei = rs['data']['area'][i];

          continue;
        }

        var provinceName = rs['data']['area'][i]['provinceName'];
        console.log({name: provinceName, value: rs['data']['area'][i]['confirmedCount']});
        dataList.push({name: provinceName, value: rs['data']['area'][i]['confirmedCount']});
        // console.log()
      }
      console.log(hubei)
      $('#hubei').html(hubei['confirmedCount'])
      draw("",dataList);

      // var dataList=[
      //   {name:"南海诸岛",value:0},
      //   {name: '北京', value: randomValue()},
      //   {name: '天津', value: randomValue()},
      //   {name: '上海', value: randomValue()},
      //   {name: '重庆', value: randomValue()},
      //   {name: '河北', value: randomValue()},
      //   {name: '河南', value: randomValue()},
      //   {name: '云南', value: randomValue()},
      //   {name: '辽宁', value: randomValue()},
      //   {name: '黑龙江', value: randomValue()},
      //   {name: '湖南', value: randomValue()},
      //   {name: '安徽', value: randomValue()},
      //   {name: '山东', value: randomValue()},
      //   {name: '新疆', value: randomValue()},
      //   {name: '江苏', value: randomValue()},
      //   {name: '浙江', value: randomValue()},
      //   {name: '江西', value: randomValue()},
      //   {name: '湖北', value: randomValue()},
      //   {name: '广西', value: randomValue()},
      //   {name: '甘肃', value: randomValue()},
      //   {name: '山西', value: randomValue()},
      //   {name: '内蒙古', value: randomValue()},
      //   {name: '陕西', value: randomValue()},
      //   {name: '吉林', value: randomValue()},
      //   {name: '福建', value: randomValue()},
      //   {name: '贵州', value: randomValue()},
      //   {name: '广东', value: randomValue()},
      //   {name: '青海', value: randomValue()},
      //   {name: '西藏', value: randomValue()},
      //   {name: '四川', value: randomValue()},
      //   {name: '宁夏', value: randomValue()},
      //   {name: '海南', value: randomValue()},
      //   {name: '台湾', value: randomValue()},
      //   {name: '香港', value: randomValue()},
      //   {name: '澳门', value: randomValue()}
      // ]
      // function randomValue() {
      //   return Math.round(Math.random()*1000);
      // }

    });
  });




</script>
</body>
</html>